-
Notifications
You must be signed in to change notification settings - Fork 118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
generating test transactions with move script #775
base: 01-17-importing_test_transactions
Are you sure you want to change the base?
generating test transactions with move script #775
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
f346475
to
337099f
Compare
apps/nextra/next.config.mjs
Outdated
source: | ||
"/indexer/indexer-sdk/documentation/advanced-tutorials/txn-scripts", | ||
destination: | ||
"/en/build/indexer/indexer-sdk/documentation/advanced-tutorials/txn-scripts", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The redirect paths (txn-scripts
) don't match the actual file name (txn-script
). This mismatch will cause the redirect to fail. The paths in the redirect configuration should be updated to use txn-script
to match the MDX file name.
Spotted by Graphite Reviewer
Is this helpful? React 👍 or 👎 to let us know.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please ensure this matches the file name
|
||
Once the Move files and configuration are set up, run the same command used to import transactions: | ||
- testing-folder is where your Move files are stored. | ||
- output-foler can be set to any folder where you want to store the generated files. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix typo: output-foler
should be output-folder
in the command line argument description. This documentation error could cause copy/paste issues for developers following these steps.
Spotted by Graphite Reviewer
Is this helpful? React 👍 or 👎 to let us know.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo output-folder
@@ -0,0 +1,78 @@ | |||
--- | |||
title: "Aptos Transaction Import" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The title Aptos Transaction Import
is inconsistent with the document's content, which focuses on generating test transactions with Move scripts. Consider updating the title to Generating Test Transactions with Move Scripts
to accurately reflect the material covered in this guide.
Spotted by Graphite Reviewer
Is this helpful? React 👍 or 👎 to let us know.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This title doesn't match, since this is using a script instead of an importer
apps/nextra/next.config.mjs
Outdated
source: | ||
"/indexer/indexer-sdk/documentation/advanced-tutorials/txn-scripts", | ||
destination: | ||
"/en/build/indexer/indexer-sdk/documentation/advanced-tutorials/txn-scripts", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please ensure this matches the file name
@@ -0,0 +1,78 @@ | |||
--- | |||
title: "Aptos Transaction Import" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This title doesn't match, since this is using a script instead of an importer
### Steps: | ||
|
||
1. **Create Your Move Project** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a <Steps>
type, which will handle this automatically. Take a look at some of the other files on ways to do it, and it'll make it easier.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh this is nice! thanks for the suggestion!
|
||
Once the Move files and configuration are set up, run the same command used to import transactions: | ||
- testing-folder is where your Move files are stored. | ||
- output-foler can be set to any folder where you want to store the generated files. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo output-folder
3. Output the generated JSON files to the designated folder (`~/aptos-core/ecosystem/indexer-grpc/indexer-transaction-generator/json_transactions`). | ||
4. Update `generated_transactions.rs` with the new transaction names specified in step 3. | ||
|
||
### How to Use the Testing Transactions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
### How to Use the Testing Transactions | |
### How to Use Test Transactions |
337099f
to
41c221f
Compare
d35779c
to
18f5a07
Compare
41c221f
to
f4a5496
Compare
18f5a07
to
e3a6dae
Compare
f4a5496
to
7c9ef01
Compare
e3a6dae
to
51b360e
Compare
7c9ef01
to
443f3c1
Compare
51b360e
to
0307421
Compare
443f3c1
to
719d843
Compare
0307421
to
d1e31ef
Compare
719d843
to
fc57bc1
Compare
apps/nextra/pages/en/build/indexer/indexer-sdk/documentation/advanced-tutorials/txn-script.mdx
Outdated
Show resolved
Hide resolved
apps/nextra/pages/en/build/indexer/indexer-sdk/documentation/advanced-tutorials/txn-script.mdx
Outdated
Show resolved
Hide resolved
apps/nextra/pages/en/build/indexer/indexer-sdk/documentation/advanced-tutorials/txn-script.mdx
Outdated
Show resolved
Hide resolved
apps/nextra/pages/en/build/indexer/indexer-sdk/documentation/advanced-tutorials/txn-script.mdx
Outdated
Show resolved
Hide resolved
apps/nextra/pages/en/build/indexer/indexer-sdk/documentation/advanced-tutorials/txn-script.mdx
Outdated
Show resolved
Hide resolved
apps/nextra/pages/en/build/indexer/indexer-sdk/documentation/advanced-tutorials/txn-script.mdx
Outdated
Show resolved
Hide resolved
apps/nextra/pages/en/build/indexer/indexer-sdk/documentation/advanced-tutorials/txn-script.mdx
Outdated
Show resolved
Hide resolved
apps/nextra/pages/en/build/indexer/indexer-sdk/documentation/advanced-tutorials/txn-script.mdx
Outdated
Show resolved
Hide resolved
apps/nextra/pages/en/build/indexer/indexer-sdk/documentation/advanced-tutorials/txn-script.mdx
Outdated
Show resolved
Hide resolved
apps/nextra/pages/en/build/indexer/indexer-sdk/documentation/advanced-tutorials/txn-script.mdx
Outdated
Show resolved
Hide resolved
fc57bc1
to
ee03a7e
Compare
|
||
|
||
## Next Steps | ||
Once the transaction constants are integrated, you can use them in processor tests to validate functionality. For detailed instructions on writing processor tests, refer to [Writing Processor Tests](). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The empty link [Writing Processor Tests]()
will be broken when rendered. Please either add the correct URL path to the parentheses or remove the Markdown link formatting if the destination page doesn't exist yet.
Spotted by Graphite Reviewer
Is this helpful? React 👍 or 👎 to let us know.
|
||
1. Read the configuration in the `move_fixtures` folder. | ||
2. Execute the specified Move scripts. | ||
3. Output the generated JSON files to the designated folder (`~/aptos-core/ecosystem/indexer-grpc/indexer-transaction-generator/json_transactions`). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The output path shown in the documentation (~/aptos-core/ecosystem/indexer-grpc/indexer-transaction-generator/json_transactions
) differs from the path specified in the command (../indexer-test-transactions/src/
). This discrepancy should be resolved to ensure users can follow the instructions correctly. Consider updating either the command or the documentation to show the correct output path.
Spotted by Graphite Reviewer
Is this helpful? React 👍 or 👎 to let us know.
5fd548e
to
aeacbb0
Compare
ee03a7e
to
8736bb3
Compare
aeacbb0
to
60db79c
Compare
8736bb3
to
260f684
Compare
### Set up `move_fixtures` folder | ||
Before proceeding, ensure you have the move_fixtures folder set up in the appropriate location: | ||
1. Location: | ||
The move_fixtures folder should be created in the `aptos-core/ecosystem/indexer-grpc/indexer-transaction-generator/imported_transactions` directory. This is the folder where Move scripts and their configurations for test transactions will be stored. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The move_fixtures folder should be created in the `aptos-core/ecosystem/indexer-grpc/indexer-transaction-generator/imported_transactions` directory. This is the folder where Move scripts and their configurations for test transactions will be stored. | |
The `move_fixtures` folder should be created in the `aptos-core/ecosystem/indexer-grpc/indexer-transaction-generator/imported_transactions` directory. This is the folder where Move scripts and their configurations for test transactions will be stored. |
1. Location: | ||
The move_fixtures folder should be created in the `aptos-core/ecosystem/indexer-grpc/indexer-transaction-generator/imported_transactions` directory. This is the folder where Move scripts and their configurations for test transactions will be stored. | ||
|
||
<Callout> **Note:** Do not create the `move_fixtures` folder in your processor repository. All Move-related files should reside in the `aptos-core` repository under the specified directory. </Callout> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why can't you put move_fixtures in the processor repository? what if they want to add the fixtures to version control?
### Set Up Test Accounts | ||
|
||
1. These accounts will be used to deploy your module. | ||
2. Set up as many accounts as you need. These accounts will be used to send the scripted transactions. Refer to the guide [here](https://aptos.dev/en/build/cli/setup-cli) to create accounts. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2. Set up as many accounts as you need. These accounts will be used to send the scripted transactions. Refer to the guide [here](https://aptos.dev/en/build/cli/setup-cli) to create accounts. | |
2. Set up as many accounts as you need. These accounts will be used to send the scripted transactions. Refer to [Aptos CLI](https://aptos.dev/en/build/cli/setup-cli) to create accounts. |
|
||
## Overview: | ||
|
||
This section outlines how to create test transactions with Move scripts. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think it'd help to have details on why you need scripted txn's, and when you would use a scripted txn instead of an imported txn
- **Add as a Dependency**: | ||
|
||
Include the crate containing the generated transactions as a dependency in the `Cargo.toml` file of your test crate. (Internally, transactions are stored in `aptos-core` and used in the [processor repo](https://github.com/aptos-labs/aptos-indexer-processors/blob/0c92d323b0f560b5f8601a831a36520ad9b72d68/rust/Cargo.toml#L34)). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not needed as per discussion on previous PR
|
||
```bash | ||
cd ~/aptos-core/ecosystem/indexer-grpc/indexer-transaction-generator | ||
cargo run -- --testing-folder ./imported_transactions --output-folder ../indexer-test-transactions/src/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cargo run -- --testing-folder ./imported_transactions --output-folder ../indexer-test-transactions/src/ | |
cargo run -- --testing-folder ./imported_transactions --output-folder /path/to/processor/repo/ |
Description
Checklist
pnpm fmt
?pnpm lint
?